/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package geradorentidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Familia
 */
@Entity
@Table(name = "slw_perfil")
@NamedQueries({
    @NamedQuery(name = "SlwPerfil.findAll", query = "SELECT s FROM SlwPerfil s"),
    @NamedQuery(name = "SlwPerfil.findByCodPerfil", query = "SELECT s FROM SlwPerfil s WHERE s.codPerfil = :codPerfil"),
    @NamedQuery(name = "SlwPerfil.findByDescricao", query = "SELECT s FROM SlwPerfil s WHERE s.descricao = :descricao")})
public class SlwPerfil implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "COD_PERFIL")
    private Integer codPerfil;
    @Basic(optional = false)
    @Column(name = "DESCRICAO")
    private String descricao;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "slwPerfil")
    private List<SlwUsuario> slwUsuarioList;

    public SlwPerfil() {
    }

    public SlwPerfil(Integer codPerfil) {
        this.codPerfil = codPerfil;
    }

    public SlwPerfil(Integer codPerfil, String descricao) {
        this.codPerfil = codPerfil;
        this.descricao = descricao;
    }

    public Integer getCodPerfil() {
        return codPerfil;
    }

    public void setCodPerfil(Integer codPerfil) {
        this.codPerfil = codPerfil;
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

    public List<SlwUsuario> getSlwUsuarioList() {
        return slwUsuarioList;
    }

    public void setSlwUsuarioList(List<SlwUsuario> slwUsuarioList) {
        this.slwUsuarioList = slwUsuarioList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codPerfil != null ? codPerfil.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SlwPerfil)) {
            return false;
        }
        SlwPerfil other = (SlwPerfil) object;
        if ((this.codPerfil == null && other.codPerfil != null) || (this.codPerfil != null && !this.codPerfil.equals(other.codPerfil))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "geradorentidades.SlwPerfil[codPerfil=" + codPerfil + "]";
    }

}
